home *** CD-ROM | disk | FTP | other *** search
- ;MDS source code for KeyEDDemo External procedures
- ;copyright F.Samuel and Mac Tutor 1988
- ; After compiling , turn the .rel file into a LSP
- ; library using rel.Converter , then include the lib
- ; into your LSP project
-
- ;MDS Glues for Pascal Peek and Poke
- ;procedure poke(address:ptr;value:byte)
- ;function peek(address:ptr): byte;
-
- XDEF peek
- XDEF poke
-
- value EQU 8
- addr1 EQU 10
-
- poke
- LINK A6,#0
- MOVEA.L addr1(A6),A0
- MOVE value(A6),D0
- MOVE.B D0,(A0)
- UNLK A6
- MOVEA.L (SP)+,A0
- ADDQ.L #6,SP
- JMP (A0)
-
- addr2 EQU 8
- result EQU 12
-
- peek
- LINK A6,#0
- MOVEA.L addr2(A6),A0
- MOVEQ #0,D0
- MOVE.B (A0),D0
- MOVE D0,result(A6)
- UNLK A6
- MOVEA.L (SP)+,A0
- ADDQ.L #4,SP
- JMP (A0)
-
- ; Function Key12Trans(KeyCode,KeyModifs:Integer) : Integer;
- ; KeyModifs are as they appear in the third word of KeyMap
- ; Function returns AsciiCode
-
- XDEF Key12Trans
-
- Key1Trans EQU $29E
- Key2Trans EQU $2A2
-
- KeyModifs EQU 8
- KeyCode EQU 10
- FunRslt EQU 12
-
- Key12Trans
-
- LINK A6,#0
- MOVEM.L A0/D0-D3,-(SP)
- MOVE KeyCode(A6),D2
- MOVE KeyModifs(A6),D1
- MOVEQ #0,D3
- CMPI #64,D2
- BHS.S @1
- MOVEA.L Key1Trans,A0
- BRA.S @2
- @1 MOVEA.L Key2Trans,A0
- @2 JSR (A0)
- MOVE D0,FunRslt(A6)
- MOVEM.L (SP)+,A0/D0-D3
- UNLK A6
- MOVEA.L (SP)+,A0
- ADDQ.L #4,SP
- JMP (A0)
-
-